<?php

class Application_Model_DbTable_DetailRecord extends Zend_Db_Table_Abstract
{

    
    protected $_name = 'detalle_expediente';
    
     public function getDetailRecord($placa)
    {        
        $row = $this->fetchAll(
            $this->select()
            ->where('placa = ?', $placa));
        if ($row) {
             return $row->toArray();
        }
        else{
            return $row;
        }
    }
    public function addDetailRecord($placa, $fecha,$cantidad,$descripcion,$precio,$tipo)
    {

        

        try{  
         
        $data = array(
            'placa' => $placa,
            'fecha' => $fecha,
            'cantidad' => $cantidad,
            'descripcion' => $descripcion,
            'precio' => $precio,
            'tipo' => $tipo,
           
        );
        $this->insert($data);
         }catch(Zend_Exception $e){
            throw $e;
        }
    }
    
    public function deleteDetailRecord($placa)
    {
        try{    
             $this->delete('placa = ' . $placa);
        }catch(Zend_Exception $e){
            throw $e;
        }
    }


}